package com.shadowtorcher.stdisk.bean;

import com.shadowtorcher.soulknife.DataSupport;
import com.shadowtorcher.soulknife.exception.BeanConfigErrorException;
import com.shadowtorcher.stdisk.util.StaticUtils;

import java.sql.SQLException;

public class PhysicsFileBean extends DataSupport {
    private String PhysicsFileID; // 主键
    private String Md5;
    private String Hash;
    private long FileSize;
    private int ReferenceCount;

    @Override
    public void save() throws BeanConfigErrorException, SQLException {
        if (this.PhysicsFileID == null) {
            this.PhysicsFileID = StaticUtils.generatorStringUUID();
        }
        super.save();
    }

    public int getReferenceCount() {
        return ReferenceCount;
    }

    public void setReferenceCount(int referenceCount) {
        ReferenceCount = referenceCount;
    }

    public String getPhysicsFileID() {
        return PhysicsFileID;
    }

    public void setPhysicsFileID(String physicsFileID) {
        PhysicsFileID = physicsFileID;
    }

    public String getMd5() {
        return Md5;
    }

    public void setMd5(String md5) {
        this.Md5 = md5;
    }

    public String getHash() {
        return Hash;
    }

    public void setHash(String hash) {
        this.Hash = hash;
    }

    public long getFileSize() {
        return FileSize;
    }

    public void setFileSize(long fileSize) {
        FileSize = fileSize;
    }
}
